#pragma once

#include "clkAbstract.h"

class clkCamera : public clkAbstract
{
private:
	DCamera m_cam;
	float   m_camX;
	float   m_camY;
	float   m_camZ;
	float   m_camXMin;
	float   m_camXMax;
	float   m_camYMin;
	float   m_camYMax;
	float   m_camZMin;
	float   m_camZMax;
	float   m_camSpd;
	float   m_camZoom;

	bool m_mouseMove;
	bool m_mouseScrl;

	V3DF* m_camAttPos;
	V3DF  m_camAttOff;
public:
	clkCamera();
	~clkCamera();

	void initCamera(
		V3DF  a_pos,
		float a_yaw,
		float a_pitch,
		float a_aspect,
		float a_near = 1.0f,
		float a_far  = 2048.0f,
		float a_fov  = D3DF_FOV,
		float a_xMin = 0,
		float a_xMax = 0,
		float a_yMin = 0,
		float a_yMax = 0,
		float a_zMin = 0,
		float a_zMax = 0,
		float a_dis  = 64.0f,
		float a_spd  = 0.003f,
		float a_zoom = 0.5f,
		bool  a_move = true,
		bool  a_scrl = true);

	virtual void input();
	virtual void update();

	void attach(V3DF* a_pos, V3DF a_off);

	void setPos(V3DF a_pos){m_cam.m_pos=a_pos;}
	void setYaw(float a_yaw){m_cam.m_yaw=a_yaw;}
	void setPitch(float a_pitch){m_cam.m_pitch=a_pitch;}
	void setDis(float a_dis){m_cam.m_dis=a_dis;}
	void setXMinMax(float a_min, float a_max)
	{m_camXMin=a_min,m_camXMax=a_max;}
	void setYMinMax(float a_min, float a_max)
	{m_camYMin=a_min,m_camYMax=a_max;}
	void setZMinMax(float a_min, float a_max)
	{m_camZMin=a_min,m_camZMax=a_max;}

	void trigMove(){m_mouseMove=!m_mouseMove;}
	void trigScrl(){m_mouseScrl=!m_mouseScrl;}
};